package com.openlogic.datasource.api.entity;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.handler.JacksonTypeHandler;
import com.openlogic.datasource.api.param.ConnectionParam;

@Table(value = "rule_datasource_metadata_source")
public class DataSourceEntity implements Serializable{
	
	private static final long serialVersionUID = 1L;

	/**
     * id
     */
    @Id
    private String id;

    /**
     * data source name
     */
    private String name;

    /**
     * note
     */
    private String note;

    /**
     * data source type
     */
    private String dbType;

    /**
     * data category
     */
    private String category;
    
    /**
     * status
     */
    private String status;
    
    /**
     * is Sync
     */
    private String isSync;
    
    /**
     * connection parameters
     */
    @Column(typeHandler = JacksonTypeHandler.class)
    private ConnectionParam connectionParams;
    
    /**
     * excel上传路径
     */
    private String excelPath;

    /**
     * create time
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@Column(value = "create_time", onInsertValue = "now()")
    private Date createTime;
    
    /**
     * createBy
     */
    private String createBy;

    /**
     * update time
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@Column(value = "update_time", onUpdateValue = "now()")
    private Date updateTime;
    
    /**
     * Update By
     */
    private String updateBy;
    
    /**
     * 主机IP|域名
     */
    @Column(ignore = true)
    private String host;
    
    /**
     * 端口号
     */
    @Column(ignore = true)
    private Integer port;
    
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getCreateBy() {
		return createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	public String getUpdateBy() {
		return updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public String getDbType() {
		return dbType;
	}

	public void setDbType(String dbType) {
		this.dbType = dbType;
	}

	public ConnectionParam getConnectionParams() {
		return connectionParams;
	}

	public void setConnectionParams(ConnectionParam connectionParams) {
		this.connectionParams = connectionParams;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getIsSync() {
		return isSync;
	}

	public void setIsSync(String isSync) {
		this.isSync = isSync;
	}

	public String getExcelPath() {
		return excelPath;
	}

	public void setExcelPath(String excelPath) {
		this.excelPath = excelPath;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public Integer getPort() {
		return port;
	}

	public void setPort(Integer port) {
		this.port = port;
	}
	
}
